<template>
  <div class="container">
    <div class="introduce-box flexCol Xcenter">
      <div class="title">赛事介绍</div>
      <div class="content">大赛参赛要求、奖励及流程</div>
    </div>
    <!--参赛人员范围-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>参赛人员范围</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于参赛人员范围</div>
        </div>
      </div>
      <div class="content">
        {{ info.member }}
      </div>
    </div>
    <!--大赛分类-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>大赛分类</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于大赛分类</div>
        </div>
      </div>
      <div class="content flexRow Xbetween">
        <div class="item" v-for="(item, index) in info.category" :key="index">
          <img src="../assets/img/introduce-icon.png" alt />
          <div>{{ item }}</div>
        </div>
      </div>
    </div>
    <!--项目要求-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>项目要求</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于项目要求</div>
        </div>
      </div>
      <div class="content flexRow Xbetween">
        <div class="item rank" v-for="(item, index) in info.claim" :key="index">
          <img :src="require(`../assets/img/${index + 1}-icon.png`)" alt />
          <div style="line-height: 36px">
            {{ item }}
          </div>
        </div>
      </div>
    </div>
    <!--参与方式-->
    <div style="background: #f7f9fd">
      <div class="content-box w1420">
        <div class="title flexRow Xcenter">
          <div class="content">
            <div class="flexRow Ycenter">
              <img src="../assets/img/outstanding-icon.png" alt />
              <span>参与方式</span>
              <img src="../assets/img/outstanding-icon.png" alt />
            </div>
            <div>关于参与方式</div>
          </div>
        </div>
        <div class="condition" v-html="info.way"></div>
      </div>
    </div>
    <!--评奖办法-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>评奖办法</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于评奖办法</div>
        </div>
      </div>
      <div class="content flexRow Xbetween">
        <div class="item medal">
          <img src="../assets/img/medal-icon1.png" alt />
          <div class="name">金奖</div>
          <div class="count">2个</div>
        </div>
        <div class="item medal">
          <img src="../assets/img/medal-icon2.png" alt />
          <div class="name">银奖</div>
          <div class="count">4个</div>
        </div>
        <div class="item medal">
          <img src="../assets/img/medal-icon3.png" alt />
          <div class="name">铜奖</div>
          <div class="count">8个</div>
        </div>
      </div>
      <div class="condition" v-html="info.price_desc"></div>
    </div>
    <!--日程安排-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>日程安排</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于日程安排</div>
        </div>
      </div>
      <div class="step flexRow Xbetween Ycenter">
        <div class="block"></div>
        <div class="dot" v-for="(item, index) in info.schedule" :key="index">
          <div :class="index == 1 ? 'msg2' : 'msg1'">
            <div class="flexRow Ycenter">
              <i class="dot"></i>
              <span>{{ item.date }}</span>
            </div>
            <div class="text">{{ item.desc }}</div>
          </div>
        </div>
        <div class="block"></div>
      </div>
    </div>
    <!--报名-->
    <div class="apply-box flexCol Xend Ycenter" :style="`background-image: url(${adImg})`">
      <!-- <div class="title">立刻加入未来发明家国际选拔赛</div>
      <div class="content">
        引导全体青少年学习并创造性地应用自己的知识储备，以展示、交流、竞技等方式进行，活动内容涉及科创、文创等
        各类智力活动成果。
      </div> -->
      <span class="btn pointer" @click="gotoApply">立即报名</span>
    </div>
    <!--其他服务-->
    <div style="background: #f7f9fd">
      <div class="content-box w1420">
        <div class="title flexRow Xcenter">
          <div class="content">
            <div class="flexRow Ycenter">
              <img src="../assets/img/outstanding-icon.png" alt />
              <span>其他服务</span>
              <img src="../assets/img/outstanding-icon.png" alt />
            </div>
            <div>关于其他服务</div>
          </div>
        </div>
        <div class="condition" v-html="info.other_service"></div>
        <!-- <div class="other">
          <div class="part">
            <p>1、住宿服务（世博展览中心附近住宿标准）</p>
            <p class="stem">1） 经济酒店双标房（不含早）</p>
            <p class="stem">
              2） 三星宾馆双标房（含双早） 3）四星宾馆双标塄（含双早）
            </p>
            <p class="stem">
              备注：请提前一周预定所需房间。订房联系人：浦江，手机号：13621721216
            </p>
          </div>
          <div class="part">
            <p>2、项目对接与考察服务</p>
            <p class="stem">如需在上海期间与项目对接单位进行考察和洽谈的，请预先与承办单位联系，承办方将根据需求进行安排。</p>
          </div>
          <div class="part">
            <p>3、展品到货站</p>
            <p class="stem">参展展品请于2021年04月14日前运抵（展品请尽量自带，若需要运输、搬运、仓储等请见第七届中国（上海）国际技术进出口交易会展商手册）。</p>
          </div>
          <div class="part">
            <p>4、项目推介会报名</p>
            <p class="stem">如需做项目推介，请在项目申报表的“囗"中打“寻"、并提供PPT资料和视频资料等，按组委会通知规定的时间参加推介会。</p>
          </div>
        </div> -->
      </div>
    </div>
    <!--联系方式-->
    <div class="content-box w1420">
      <div class="title flexRow Xcenter">
        <div class="content">
          <div class="flexRow Ycenter">
            <img src="../assets/img/outstanding-icon.png" alt />
            <span>联系方式</span>
            <img src="../assets/img/outstanding-icon.png" alt />
          </div>
          <div>关于联系方式</div>
        </div>
      </div>
      <div class="contact">
        <el-form label-position="left" label-width="116px">
          <el-form-item label="通讯地址：">
            {{ info.address }}
          </el-form-item>
          <el-form-item label="电子邮箱：">
            {{ info.email }}
          </el-form-item>
          <el-form-item label="电话：">
            <p v-for="(item, index) in info.phone" :key="index">{{ item }}</p>
          </el-form-item>
          <el-form-item label="联系人：">
            <p v-for="(item, index) in info.contact" :key="index">{{ item }}</p>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import { ad } from "../api/home";
import { competitionInfo } from "../api/introduce";
export default {
  data() {
    return {
      adImg: "",
      info: {},
    };
  },
  computed: {
    userInfo: {
      get() {
        return this.$store.getters.userInfo;
      },
    },
  },
  mounted() {
    this.getAd();
    this.getDetail();
  },
  methods: {
    // 推广图
    getAd() {
      ad({
        type: "index",
      }).then((res) => {
        this.adImg = res.data.advertisement1;
      });
    },
    getDetail() {
      competitionInfo().then((res) => {
        this.info = res.data;
      });
    },
    gotoApply() {
      if (JSON.stringify(this.userInfo) != "{}") {
        this.$router.push({ path: "/apply" });
      } else {
        // 呼出登录弹框
        this.$store.dispatch("settings/changeSetting", {
          key: "loginDialogFormVisible",
          value: true,
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.introduce-box {
  width: 100%;
  height: 400px;
  background: url("../assets/img/introduce-bg.png") no-repeat center center;
  background-size: cover;
  padding-left: 249px;
  box-sizing: border-box;
  color: #ffffff;
  .title {
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 15px;
  }
  .content {
    font-size: 28px;
  }
}
.content-box {
  padding-top: 79px;
  padding-bottom: 49px;
  & > .title {
    text-align: center;
    .content {
      div:first-child {
        margin-bottom: 26px;
        img {
          width: 32px;
          height: 28px;
        }
        span {
          font-size: 36px;
          color: #262626;
          margin: 0 25px;
        }
      }
      div:last-child {
        font-size: 20px;
        color: #999999;
      }
    }
  }
  & > .content {
    text-align: center;
    font-size: 20px;
    color: #666666;
    margin-top: 60px;
    .item {
      width: 470px;
      text-align: center;
      img {
        width: 42px;
        height: 40px;
        margin-bottom: 24px;
      }
      &.rank {
        img {
          height: 42px;
        }
      }
      &.medal {
        img {
          width: 78px;
          height: 100px;
        }
        .name {
          font-size: 28px;
          color: #262626;
          margin-bottom: 16px;
        }
        .count {
          font-size: 20px;
          color: #999999;
        }
      }
    }
  }
  & > .condition {
    margin-top: 78px;
    /deep/ p {
      color: #262626;
      font-size: 22px;
      line-height: 36px;
      margin-bottom: 30px;
      // span:last-child {
      //   color: #666666;
      //   font-size: 20px;
      //   font-weight: 400;
      // }
    }
  }
  & > .step {
    height: 4px;
    background: rgba(51, 133, 255, 0.2);
    margin-top: 221px;
    margin-bottom: 366px;
    .block {
      width: 26px;
      height: 26px;
      background: #3385ff;
    }
    & > .dot {
      width: 12px;
      height: 12px;
      background: #ebcd91;
      border-radius: 50%;
      position: relative;
      .msg1 {
        padding: 30px;
        box-sizing: border-box;
        background: #f7f9fd;
        border-radius: 10px;
        color: #999999;
        font-size: 20px;
        width: 372px;
        position: absolute;
        left: -180px;
        bottom: 46px;
        &::after {
          display: block;
          content: "";
          width: 0;
          height: 0;
          border-top: 16px solid #f7f9fd;
          border-right: 16px solid transparent;
          border-left: 16px solid transparent;
          position: absolute;
          bottom: -16px;
          left: 170px;
        }
        i.dot {
          display: inline-block;
          width: 10px;
          height: 10px;
          background: #ebcd91;
          border-radius: 50%;
          margin-right: 9px;
        }
        .text {
          padding-left: 19px;
          font-size: 18px;
          margin-top: 15px;
        }
      }
      .msg2 {
        padding: 30px;
        box-sizing: border-box;
        background: #f7f9fd;
        border-radius: 10px;
        color: #999999;
        font-size: 20px;
        width: 372px;
        position: absolute;
        left: -180px;
        top: 46px;
        &::after {
          display: block;
          content: "";
          width: 0;
          height: 0;
          border-bottom: 16px solid #f7f9fd;
          border-right: 16px solid transparent;
          border-left: 16px solid transparent;
          position: absolute;
          top: -16px;
          left: 170px;
        }
        i.dot {
          display: inline-block;
          width: 10px;
          height: 10px;
          background: #ebcd91;
          border-radius: 50%;
          margin-right: 9px;
        }
        .text {
          padding-left: 19px;
          font-size: 18px;
          margin-top: 15px;
          line-height: 30px;
        }
      }
    }
  }
  & > .other {
    margin-top: 78px;
    .part {
      margin-bottom: 30px;
      p {
        color: #262626;
        font-size: 22px;
        font-weight: bold;
        line-height: 36px;
        &.stem {
          color: #666666;
          font-size: 20px;
          font-weight: 400;
        }
      }
    }
  }
  & > .contact {
    width: 800px;
    padding: 57px;
    padding-bottom: 35px;
    box-sizing: border-box;
    margin: 0 auto;
    margin-top: 57px;
    background: #f7f9fd;
    border-radius: 10px;
    /deep/ .el-form {
      color: #999999;
      .el-form-item__label {
        font-size: 20px;
        padding: 0;
      }
      .el-form-item__content {
        font-size: 20px;
      }
    }
  }
}

.apply-box {
  width: 100%;
  padding: 0 0 100px;
  height: 600px;
  box-sizing: border-box;
  background: no-repeat center center;
  background-size: cover;
  text-align: center;
  .title {
    font-size: 60px;
    font-weight: 500;
    color: #ffffff;
  }
  .content {
    width: 1018px;
    font-size: 20px;
    line-height: 36px;
    color: #ffffff;
    margin: 79px auto 107px;
  }
  .btn {
    display: inline-block;
    width: 240px;
    height: 80px;
    background: #e2c281;
    border-radius: 40px;
    font-size: 32px;
    color: #ffffff;
    line-height: 80px;
  }
}
</style>